
package com.lgcns.android2;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;

public class PhotoEnlagerActivity extends Activity implements OnClickListener {

    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        setContentView(R.layout.photo_enlager);
        
        LinearLayout ll = (LinearLayout) findViewById(R.id.photoEnlargerLayout);
        ll.setOnClickListener(this);

        Intent intent = getIntent();
        int idNum = intent.getIntExtra(Constants.ID_NUM, 0);

        Bitmap bm = Util.getProfileImage(this, idNum);

        int newWidth = (int) (bm.getWidth() * 1.3);
        int newHeight = (int) (bm.getHeight() * 1.3);

        Bitmap newBm = Bitmap.createScaledBitmap(bm, newWidth, newHeight, true); 

        ImageView iv = (ImageView) findViewById(R.id.photo);
        iv.setImageBitmap(newBm);
    }

    @Override
    public void onClick(View v) {
        finish();
        overridePendingTransition(0, R.anim.fadeout);
    }

}
